package presentation;

import javax.swing.JLabel;

public class RollLabel implements Runnable {
    private JLabel label;

    public RollLabel(JLabel label) {
        this.label = label;
    }

    public void run() {
        try {
            while (true) {
                String text = label.getText();
                if (text.length() > 1) {
                    text = text.substring(1, text.length()) + text.charAt(0);
                    label.setText(text);
                    label.repaint();
                }
                Thread.sleep(500);
            }
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        }
    }
}